var dealrotator = {
	cache:0,
	initialize: function(v){
		this.dealids = v.dealids;
		
		if(v.rotate)
			this.rotate(v);
	},
	rotate: function(v){
		setInterval(function(){
			if(dealrotator.cache != null){
				var i=0;
				for(var i in v.dealids)
					if(v.dealids[i])
						v.dealids[i].style['display']="none";
						
				dealrotator.cache++;
				if(dealrotator.cache < v.dealids.length){
					if(v.dealids[dealrotator.cache])
						v.dealids[dealrotator.cache].style['display']='block';
				}else{
					if(v.dealids[0])
						v.dealids[0].style['display']='block';
					dealrotator.cache=0;
				}
			}
		},4000);
	},
	click: function(v){
		dealrotator.cache=null;
		for(var i in v.close){
			if(document.getElementById(v.close[i])){
				document.getElementById(v.close[i]).style['display']='none';
			}
		}
		
		document.getElementById(v.show).style['display']='block';
	}
}